﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace TaiDouPhotonServer.Tools
{
    //MD5工具
    public class MD5Tool
    {
        public static string Md5Hash(string source)
        {
            byte[] strBytes = Encoding.UTF8.GetBytes(source);
            MD5 md5 = new MD5CryptoServiceProvider();
            byte[] md5Bytes = md5.ComputeHash(strBytes);

            string result = BitConverter.ToString(md5Bytes).Replace("-", "");

            return result.ToLower();
        }
    }
}
